<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Classes\code\Code;
use Illuminate\Support\Facades\Input;

class LoginController extends Controller
{
    public function login()
    {
        if( $input = Input::all() )
        {
            $yzm = $this->_checkcode();
            if( $yzm != strtoupper( $input['code'] ) )
            {
                return back()->with('msg','验证码错误');
            }
        }
        return view('admin.login');
    }

    public function genCaptcha()
    {
        $code = new Code();
        $code->make();
    }

    private function _checkcode()
    {
        $code = new Code();
        return $code->get();
    }

    /*

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration
{

    public function up()
    {
        Scheam::create('merchant_update_bank_card_logs',function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('user_id');     //用户ID
            $table->integer('bank_id');     //银行ID
            $table->string('bank_number');  //银行卡号
            $table->string('phone');        //手机号
            $table->string('name');         //用户姓名
            $table->string('open_bank');    //开户银行
            $table->tinyInteger('type');    //银行卡类型 0为商家货款卡，1为工资卡，默认为0
            $table->integer('area_id');     //区域ID
            $table->decimal('money',18,2)->default('0.00'); //打款金额 0.00元
            $table->string('yurref');       //业务流水号
            $table->string('reqnbr');       //银行流水号
            $table->tinyInteger('step')->default('0');          //默认0待填写银行卡信息  1等待金额打入账户  2用户验证金额  3绑定成功
            $table->tinyInteger('status')->default('0');        //审核状态 0待审核 1通过 2驳回
            $table->tinyInteger('deal_status')->default('0');   //绑定状态   默认0待绑定 1.银行卡填写错误  2开户人姓名有误  3开户行信息不符  4留存手机号有误 5初步绑定成功 6进入待审核
            $table->timestamps();
        });
    }


    public function down()
    {
        Schema::drop('merchant_update_bank_card_logs');
    }
}


*/
}